package thinker.miracle.business.logger.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import thinker.miracle.business.logger.dao.LoggerDao;
import thinker.miracle.business.logger.entity.LoggerEntity;


/**
 * @author bo.chen
 *
 */
@Service
public class LoggerService {
	
	@Autowired
	LoggerDao loggerDao;

	/**
	 * 保存日志信息
	 * 
	 * @param loggerEntity
	 *
	 */
	@Transactional
	public void save(LoggerEntity loggerEntity){
		if(loggerEntity == null || loggerEntity.getUrl() == null )
			throw new RuntimeException("日志记录失败");
		loggerDao.insert(loggerEntity);
	}
}